package cn.donghuapian.controller;

import cn.donghuapian.entity.UserEntity;
import cn.donghuapian.service.IUserService;
import cn.donghuapian.vo.ResponseBody;
import cn.donghuapian.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hzw
 * @since 2024-09-26
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @PostMapping("/login")
    public ResponseBody<UserVO> login(@RequestBody UserEntity entity) {
        return userService.login(entity);
    }
}
